package com.xy6.struct.stack;


public class StackTest {

	public static void main(String[] args) {
//		test1();
		test2();
	}

	public static void test1(){
		Stack<Integer> s = new Stack<>();
		System.out.println(s.size());
		
		// 入栈
		s.push(2);
		s.push(1);
		s.push(3);
		System.out.println(s);
		
		// 出栈
		Integer i = s.pop();
		System.out.println(i);
		System.out.println(s.size());
		System.out.println(s.pop());
		System.out.println(s.size());
		s.push(5);
		System.out.println(s.size());
	}
	
	public static void test2(){
		Stack2<Integer> s = new Stack2<>();
		s.print();
		
		// 入栈
		s.push(2);
		s.push(1);
		s.push(3);
		s.print();
		
		// 出栈
		Integer i = s.pop();
		System.out.println(i);
		s.print();
		System.out.println(s.pop());
		s.print();
		s.push(5);
		s.print();
	}
	
}
